package com.gmall.rabbitmq.consumer.service;

import com.gmall.rabbitmq.config.DefaultExchange_Queue_Config;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service

public class DefaultExQueueService {

    @RabbitListener(queues = {
            DefaultExchange_Queue_Config.DEFAULT_EX_QUEUE,
            DefaultExchange_Queue_Config.DEFAULT_EX_QUEUE_1,
            DefaultExchange_Queue_Config.DEFAULT_EX_QUEUE_2,})
    public void consumeSmsMsg(Channel channal, Message message, String msg){
        String consumerQueue =
                message.getMessageProperties().getConsumerQueue();
        System.out.println(consumerQueue +":" +msg);
    }

}
